package org.tao.lightningmq.broker.utils;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @Author lht
 * @date 2025/1/3 - 16:23
 * @description:
 */
public class UnfairReentrantLock implements PutMessageLock, AckMessageLock{

    private final Lock lock;

    public UnfairReentrantLock() {
        this.lock = new ReentrantLock();
    }

    @Override
    public void lock() {
        lock.lock();
    }

    @Override
    public void unlock() {
        lock.unlock();
    }
}
